package com.hackerank.arrays;

/***
 * 数组逆转 Arrays - DS
 * https://www.hackerrank.com/challenges/arrays-ds/problem
 *
 * 题目大意：
 * 1、对输入长度为n的数组逆转输出
 * */
public class ArraysReverse {
    static int[] reverseArray(int[] a) {
        for(int i=0,mid=a.length>>1,j=a.length-1;i<mid;i++,j--){
            int temp = a[i];
            a[i] = a[j];
            a[j] = temp;
        }
        return a;
    }
}
